<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>all和race</title>
</head>
<body>

</body>
<script>

    var pool = ()=>{
        return new Promise((resolve)=>{
             setTimeout(()=>{
                 resolve("result1");
             },1000)
        })
    }

    var poo2 = ()=>{
        return new Promise((resolve)=>{
            setTimeout(()=>{

                resolve("result2");
            },2000)
        })
    }

    var poo3 = ()=>{
        return new Promise((resolve)=>{
            setTimeout(()=>{
                resolve("result3");
            },2500)
        })
    }


    Promise.all([pool(),poo2(),poo3()]).then((result)=>{
         console.log(result);
    })


    Promise.race([pool(),poo2(),poo3()]).then((result)=>{
        console.log(result);
    })
</script>
</html>